<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>发现好货 - 社交供给平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4361ee;
            --primary-light: #eef0ff;
            --secondary: #3f37c9;
            --accent: #4cc9f0;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #6c757d;
            --light-gray: #e9ecef;
            --success: #4cc9f0;
            --danger: #f72585;
        }
        
        body {
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            background-color: #f5f7fa;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .navbar {
            background-color: white;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        
        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .search-bar {
            max-width: 500px;
            width: 100%;
        }
        
        .section-title {
            font-size: 1.75rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            position: relative;
            padding-bottom: 0.75rem;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 50px;
            height: 3px;
            background-color: var(--primary);
            border-radius: 3px;
        }
        
        .supply-card {
            background-color: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            margin-bottom: 1.5rem;
        }
        
        .supply-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        }
        
        .supply-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem;
            border-bottom: 1px solid var(--light-gray);
        }
        
        .author-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .author-info {
            flex: 1;
        }
        
        .author-name {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--dark);
            text-decoration: none;
        }
        
        .author-name:hover {
            color: var(--primary);
        }
        
        .post-time {
            font-size: 0.8rem;
            color: var(--gray);
        }
        
        .supply-content {
            padding: 1rem;
        }
        
        .supply-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            font-size: 1.1rem;
            color: var(--dark);
        }
        
        .supply-description {
            color: var(--gray);
            margin-bottom: 1rem;
            font-size: 0.95rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .supply-meta {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            color: var(--gray);
            font-size: 0.85rem;
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        
        .supply-actions {
            display: flex;
            justify-content: space-around;
            padding: 0.75rem 0;
            border-top: 1px solid var(--light-gray);
        }
        
        .action-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--gray);
            background: none;
            border: none;
            padding: 0.5rem 1rem;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
            border-radius: 6px;
        }
        
        .action-btn:hover {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.saved {
            color: var(--primary);
        }
        
        /* 网格布局样式 */
        .grid-layout {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        
        .grid-supply-card {
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        
        .image-container {
            width: 100%;
            overflow: hidden;
            position: relative;
        }
        
        .single-image {
            width: 100%;
            height: 200px;
            object-fit: cover;
            transition: transform 0.5s ease;
        }
        
        .supply-card:hover .single-image {
            transform: scale(1.05);
        }
        
        .multi-image {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            grid-template-rows: repeat(2, 1fr);
            gap: 3px;
            height: 200px;
        }
        
        .multi-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .multi-image .image-count {
            position: absolute;
            bottom: 5px;
            right: 5px;
            background-color: rgba(0,0,0,0.7);
            color: white;
            font-size: 0.8rem;
            padding: 2px 6px;
            border-radius: 4px;
        }
        
        /* 列表布局样式 */
        .list-supply-card {
            display: flex;
            flex-direction: row;
            height: auto;
        }
        
        .list-image-container {
            width: 200px;
            flex-shrink: 0;
        }
        
        .list-supply-content {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        /* 大图布局样式 */
        .large-image {
            width: 100%;
            height: 400px;
            object-fit: cover;
        }
        
        /* 无图布局样式 */
        .no-image-card {
            border-left: 4px solid var(--primary);
        }
        
        /* 分类筛选 */
        .categories {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 2rem;
            overflow-x: auto;
            padding-bottom: 0.5rem;
        }
        
        .category-btn {
            background-color: white;
            border: 1px solid var(--light-gray);
            border-radius: 20px;
            padding: 0.5rem 1.25rem;
            font-size: 0.9rem;
            white-space: nowrap;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .category-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .category-btn:hover:not(.active) {
            border-color: var(--primary);
            color: var(--primary);
        }
        
        /* 布局切换按钮 */
        .layout-controls {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
        
        .layout-btn {
            background-color: white;
            border: 1px solid var(--light-gray);
            border-radius: 6px;
            padding: 0.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .layout-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        @media (max-width: 768px) {
            .list-supply-card {
                flex-direction: column;
            }
            
            .list-image-container {
                width: 100%;
            }
            
            .large-image {
                height: 250px;
            }
            
            .section-title {
                font-size: 1.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg py-3 px-4">
        <div class="container">
            <a href="#" class="logo">
                <i class="fas fa-store"></i>
                SupplyHub
            </a>
            
            <div class="search-bar mx-auto">
                <div class="input-group">
                    <span class="input-group-text bg-transparent border-right-0">
                        <i class="fas fa-search text-gray-400"></i>
                    </span>
                    <input type="text" class="form-control border-left-0" placeholder="搜索供给、商品或服务...">
                </div>
            </div>
            
            <div class="d-flex align-items-center gap-3">
                <button class="btn btn-outline-primary">
                    <i class="fas fa-plus me-1"></i> 发布供给
                </button>
                <img src="https://picsum.photos/100/100?random=1" alt="用户头像" class="rounded-circle" style="width: 38px; height: 38px; object-fit: cover;">
            </div>
        </div>
    </nav>
    
    <!-- 主内容区 -->
    <div class="container py-5">
        <!-- 分类筛选 -->
        <div class="categories">
            <button class="category-btn active">全部供给</button>
            <button class="category-btn">数码产品</button>
            <button class="category-btn">家居用品</button>
            <button class="category-btn">服装配饰</button>
            <button class="category-btn">服务技能</button>
            <button class="category-btn">二手闲置</button>
            <button class="category-btn">创意作品</button>
            <button class="category-btn">食品饮料</button>
        </div>
        
        <!-- 布局切换 -->
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h2 class="section-title mb-0">为你推荐</h2>
            <div class="layout-controls">
                <button class="layout-btn active" data-layout="grid">
                    <i class="fas fa-th"></i>
                </button>
                <button class="layout-btn" data-layout="list">
                    <i class="fas fa-list"></i>
                </button>
                <button class="layout-btn" data-layout="large">
                    <i class="fas fa-th-large"></i>
                </button>
            </div>
        </div>
        
        <!-- 网格布局供给 -->
        <div class="supplies-container grid-layout">
            <!-- 单图供给 -->
            <div class="supply-card grid-supply-card">
                <div class="supply-header">
                    <img src="https://picsum.photos/100/100?random=10" alt="用户头像" class="author-avatar">
                    <div class="author-info">
                        <a href="#" class="author-name">数码爱好者</a>
                        <div class="post-time">2小时前</div>
                    </div>
                </div>
                <div class="image-container">
                    <img src="https://picsum.photos/600/400?random=20" alt="无线耳机" class="single-image">
                </div>
                <div class="supply-content">
                    <h3 class="supply-title">全新无线降噪耳机，未拆封低价转让</h3>
                    <p class="supply-description">最新款无线降噪耳机，朋友送的礼物，自己已经有一个了，全新未拆封，低价转让给需要的朋友。</p>
                    <div class="supply-meta">
                        <div class="meta-item">
                            <i class="fas fa-eye"></i>
                            <span>328</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-comment"></i>
                            <span>24</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-heart"></i>
                            <span>56</span>
                        </div>
                    </div>
                </div>
                <div class="supply-actions">
                    <button class="action-btn">
                        <i class="fas fa-thumbs-up"></i>
                        <span>点赞</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-comment"></i>
                        <span>评论</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-heart"></i>
                        <span>收藏</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-share-alt"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
            
            <!-- 多图供给 -->
            <div class="supply-card grid-supply-card">
                <div class="supply-header">
                    <img src="https://picsum.photos/100/100?random=11" alt="用户头像" class="author-avatar">
                    <div class="author-info">
                        <a href="#" class="author-name">家居达人</a>
                        <div class="post-time">昨天 15:30</div>
                    </div>
                </div>
                <div class="image-container">
                    <div class="multi-image">
                        <img src="https://picsum.photos/300/300?random=21" alt="北欧风格沙发">
                        <img src="https://picsum.photos/300/300?random=22" alt="沙发细节">
                        <img src="https://picsum.photos/300/300?random=23" alt="沙发搭配">
                        <img src="https://picsum.photos/300/300?random=24" alt="客厅全景">
                        <div class="image-count">4图</div>
                    </div>
                </div>
                <div class="supply-content">
                    <h3 class="supply-title">北欧风格三人沙发，9成新，自提</h3>
                    <p class="supply-description">去年购买的北欧风格三人沙发，因搬家转让，9成新，无破损，舒适耐用，适合小户型客厅。</p>
                    <div class="supply-meta">
                        <div class="meta-item">
                            <i class="fas fa-eye"></i>
                            <span>512</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-comment"></i>
                            <span>47</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-heart"></i>
                            <span>89</span>
                        </div>
                    </div>
                </div>
                <div class="supply-actions">
                    <button class="action-btn liked">
                        <i class="fas fa-thumbs-up"></i>
                        <span>124</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-comment"></i>
                        <span>评论</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-heart"></i>
                        <span>收藏</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-share-alt"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
            
            <!-- 无图供给 -->
            <div class="supply-card grid-supply-card no-image-card">
                <div class="supply-header">
                    <img src="https://picsum.photos/100/100?random=12" alt="用户头像" class="author-avatar">
                    <div class="author-info">
                        <a href="#" class="author-name">编程达人</a>
                        <div class="post-time">3天前</div>
                    </div>
                </div>
                <div class="supply-content">
                    <h3 class="supply-title">提供Python编程一对一教学服务，零基础入门</h3>
                    <p class="supply-description">计算机专业硕士，5年编程经验，提供Python编程一对一在线教学，适合零基础入门，课程内容包括基础语法、数据分析、爬虫开发等。</p>
                    <div class="supply-meta">
                        <div class="meta-item">
                            <i class="fas fa-eye"></i>
                            <span>763</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-comment"></i>
                            <span>68</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-heart"></i>
                            <span>125</span>
                        </div>
                    </div>
                </div>
                <div class="supply-actions">
                    <button class="action-btn">
                        <i class="fas fa-thumbs-up"></i>
                        <span>点赞</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-comment"></i>
                        <span>评论</span>
                    </button>
                    <button class="action-btn saved">
                        <i class="fas fa-heart"></i>
                        <span>已收藏</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-share-alt"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
            
            <!-- 列表布局供给 (在列表视图中显示) -->
            <div class="supply-card list-supply-card">
                <div class="list-image-container image-container">
                    <img src="https://picsum.photos/400/400?random=25" alt="手工编织包" class="single-image">
                </div>
                <div class="list-supply-content">
                    <div class="supply-header">
                        <img src="https://picsum.photos/100/100?random=13" alt="用户头像" class="author-avatar">
                        <div class="author-info">
                            <a href="#" class="author-name">手工爱好者</a>
                            <div class="post-time">4天前</div>
                        </div>
                    </div>
                    <div class="supply-content">
                        <h3 class="supply-title">手工编织复古风包包，独一无二的设计</h3>
                        <p class="supply-description">纯手工编织的复古风包包，采用优质棉线，耗时一周完成，每个都是独一无二的设计，适合搭配各种风格的服装，尺寸约25x18cm。</p>
                        <div class="supply-meta">
                            <div class="meta-item">
                                <i class="fas fa-eye"></i>
                                <span>924</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-comment"></i>
                                <span>87</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-heart"></i>
                                <span>215</span>
                            </div>
                        </div>
                    </div>
                    <div class="supply-actions">
                        <button class="action-btn liked">
                            <i class="fas fa-thumbs-up"></i>
                            <span>186</span>
                        </button>
                        <button class="action-btn">
                            <i class="fas fa-comment"></i>
                            <span>评论</span>
                        </button>
                        <button class="action-btn">
                            <i class="fas fa-heart"></i>
                            <span>收藏</span>
                        </button>
                        <button class="action-btn">
                            <i class="fas fa-share-alt"></i>
                            <span>分享</span>
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- 大图布局供给 (在大图视图中显示) -->
            <div class="supply-card large-image-card">
                <div class="supply-header">
                    <img src="https://picsum.photos/100/100?random=14" alt="用户头像" class="author-avatar">
                    <div class="author-info">
                        <a href="#" class="author-name">摄影爱好者</a>
                        <div class="post-time">1周前</div>
                    </div>
                </div>
                <div class="image-container">
                    <img src="https://picsum.photos/1200/600?random=26" alt="风景摄影作品" class="large-image">
                </div>
                <div class="supply-content">
                    <h3 class="supply-title">原创风景摄影作品，限量版画出售</h3>
                    <p class="supply-description">这是我在西藏旅行时拍摄的风景作品，采用专业相机和镜头，展现了高原独特的自然风光。现在提供限量版打印，尺寸可选，适合家居装饰或收藏。</p>
                    <div class="supply-meta">
                        <div class="meta-item">
                            <i class="fas fa-eye"></i>
                            <span>1542</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-comment"></i>
                            <span>132</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-heart"></i>
                            <span>356</span>
                        </div>
                    </div>
                </div>
                <div class="supply-actions">
                    <button class="action-btn liked">
                        <i class="fas fa-thumbs-up"></i>
                        <span>428</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-comment"></i>
                        <span>评论</span>
                    </button>
                    <button class="action-btn saved">
                        <i class="fas fa-heart"></i>
                        <span>已收藏</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-share-alt"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
            
            <!-- 另一个无图供给 -->
            <div class="supply-card grid-supply-card no-image-card">
                <div class="supply-header">
                    <img src="https://picsum.photos/100/100?random=15" alt="用户头像" class="author-avatar">
                    <div class="author-info">
                        <a href="#" class="author-name">语言达人</a>
                        <div class="post-time">2周前</div>
                    </div>
                </div>
                <div class="supply-content">
                    <h3 class="supply-title">提供英语翻译服务，专业八级，价格优惠</h3>
                    <p class="supply-description">英语专业八级，3年翻译经验，可提供文档翻译、口译、校对等服务，领域包括商务、法律、技术等，价格优惠，欢迎咨询。</p>
                    <div class="supply-meta">
                        <div class="meta-item">
                            <i class="fas fa-eye"></i>
                            <span>632</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-comment"></i>
                            <span>45</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-heart"></i>
                            <span>98</span>
                        </div>
                    </div>
                </div>
                <div class="supply-actions">
                    <button class="action-btn">
                        <i class="fas fa-thumbs-up"></i>
                        <span>点赞</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-comment"></i>
                        <span>评论</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-heart"></i>
                        <span>收藏</span>
                    </button>
                    <button class="action-btn">
                        <i class="fas fa-share-alt"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 加载更多按钮 -->
        <div class="text-center mt-4">
            <button class="btn btn-outline-primary px-5 py-2">
                <i class="fas fa-refresh me-1"></i> 加载更多
            </button>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 布局切换功能
            const layoutBtns = document.querySelectorAll('.layout-btn');
            const suppliesContainer = document.querySelector('.supplies-container');
            
            layoutBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    // 更新按钮活跃状态
                    layoutBtns.forEach(b => b.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 切换布局
                    const layout = this.getAttribute('data-layout');
                    suppliesContainer.className = 'supplies-container';
                    
                    if (layout === 'grid') {
                        suppliesContainer.classList.add('grid-layout');
                    } else if (layout === 'list') {
                        suppliesContainer.classList.add('list-layout');
                    } else if (layout === 'large') {
                        suppliesContainer.classList.add('large-layout');
                    }
                });
            });
            
            // 分类筛选功能
            const categoryBtns = document.querySelectorAll('.category-btn');
            
            categoryBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    categoryBtns.forEach(b => b.classList.remove('active'));
                    this.classList.add('active');
                    // 实际应用中这里会根据分类筛选内容
                });
            });
            
            // 点赞功能
            const likeBtns = document.querySelectorAll('.action-btn:has(.fa-thumbs-up)');
            
            likeBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    this.classList.toggle('liked');
                    
                    // 更新点赞数
                    const likeCount = this.querySelector('span');
                    if (this.classList.contains('liked')) {
                        // 如果之前没有点赞
                        if (likeCount.textContent === '点赞') {
                            likeCount.textContent = '1';
                        } else {
                            likeCount.textContent = (parseInt(likeCount.textContent) + 1).toString();
                        }
                    } else {
                        // 如果之前有点赞
                        const count = parseInt(likeCount.textContent);
                        if (count <= 1) {
                            likeCount.textContent = '点赞';
                        } else {
                            likeCount.textContent = (count - 1).toString();
                        }
                    }
                });
            });
            
            // 收藏功能
            const saveBtns = document.querySelectorAll('.action-btn:has(.fa-heart)');
            
            saveBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    this.classList.toggle('saved');
                    
                    // 更新收藏文本
                    const saveText = this.querySelector('span');
                    if (this.classList.contains('saved')) {
                        saveText.textContent = '已收藏';
                    } else {
                        saveText.textContent = '收藏';
                    }
                });
            });
        });
    </script>
</body>
</html>

